import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../components/index.vue'
import Dynamic from '../components/dynamic.vue'
import DetailsBtn from '../components/detailsBtn.vue'
import Dooperation from '../components/cooperation.vue'
import Aboutus from '../components/aboutus.vue'
import Helpcenter from '../components/helpcenter.vue'

Vue.use(VueRouter)

const routes = [
  // 重置路由路径指向
  {
    path: '/',
    redirect: '/index'
  },
  // index路由规则
  {
    path: '/index',
    component: Index
  },
  // dynamic路由规则
  {
    path: '/dynamic',
    component: Dynamic
  },
  // detailsBtn路由规则
  {
    path: '/detailsBtn/:id',
    component: DetailsBtn,
    props: true
  },
  // cooperation路由规则
  {
    path: '/cooperation',
    component: Dooperation
  },
  // Dboutus路由规则
  {
    path: '/aboutus',
    component: Aboutus
  },
  // Helpcenter路由规则
  {
    path: '/helpcenter',
    component: Helpcenter
  }
]

const router = new VueRouter({
  routes
})

export default router
